package com.dearbinge.data.dao.moments;

import com.dearbinge.data.pojo.moments.BusinessCircleClickDO;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;

/**
 * 社交圈点击量dao
 *
 * @author wes
 * @date 2019/3/29
 */
@Mapper
public interface BusinessCircleClickMapper {

    /**
     * 根据id查询
     * @param clickId id
     * @return 影响行数
     */
    int deleteById(Integer clickId);

    /**
     * 插入
     * @param businessCircleClickDO DO
     * @return 影响行数
     */
    int insert(BusinessCircleClickDO businessCircleClickDO);

    /**
     * 根据id查询
     * @param clickId id
     * @return BusinessCircleClickDO
     */
    BusinessCircleClickDO getById(Integer clickId);

    /**
     * 根据商品id查询
     * @param commodityId id
     * @return BusinessCircleClickDO
     */
    BusinessCircleClickDO getByCommodityId(Integer commodityId);


    /**
     * 更新
     * @param businessCircleClickDO DO
     * @return 影响行数
     */
    int update(BusinessCircleClickDO businessCircleClickDO);

    /**
     * 增加点击量
     * @param clickId 表id
     * @param type 1：商品 2：客服 3：分享 4：秀场
     * @return 影响行数
     */
    int updateClick(@Param("clickId") Integer clickId, @Param("type")Integer type);



}